package com.lifang.test1;

import com.lifang.framework.annotation.beans.Component;
import com.lifang.framework.annotation.beans.PostConstruct;
import com.lifang.framework.annotation.beans.PreDestroy;
import com.lifang.framework.beans.BeansException;
import com.lifang.framework.beans.factory.BeanFactory;
import com.lifang.framework.beans.factory.BeanFactoryAware;
import com.lifang.framework.beans.factory.BeanNameAware;
import com.lifang.framework.beans.factory.DisposableBean;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Component
public class UserServiceImplA implements UserService, BeanNameAware, BeanFactoryAware, DisposableBean {

    @Override
    public void sayHello(String name) {
        log.info("你好啊{}", name);
    }

    @Override
    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
        log.info("感知到BeanFactory {}", beanFactory);
    }

    @Override
    public void setBeanName(String name) {
        log.info("感知到BeanName {}", name);
    }

    @Override
    public void destroy() throws Exception {
        log.info("我被销毁了destroy");
    }

    @PostConstruct
    public void afterPropertiesSet() throws Exception {
        log.info("我的属性赋值完毕了");
    }

    @PreDestroy
    public void destroy1() {
        log.info("我被销毁了destroy1");
    }

}
